Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix incorrect _ONEDPL_SYCL_USM_HOST_PRESENT usage in USM allocation helpers #1502

Closed
wants to merge 2 commits into from

Conversation

mmichel11
Copy link
Contributor

__use_USM_allocations introduced in PR #1354 uses _ONEDPL_SYCL_USM_HOST_PRESENT to check if host memory support is present. However, this macro was renamed to _ONEDPL_SYCL_UNIFIED_USM_BUFFER_PRESENT in PR #1410, so the function always returns false. This causes incompatible scratch and result buffer paths to be taken in the code causing incorrect results and hangs.

This PR switches to use the correct macro here.

…SYCL_USM_HOST_PRESENT

Signed-off-by: Matthew Michel <matthew.michel@intel.com>
Signed-off-by: Matthew Michel <matthew.michel@intel.com>
@julianmi
Copy link
Contributor

@mmichel11 Thanks for raising this. I noticed several issues as well and am working on fixes for them. Namely:

  1. Outdated macro as you suggested.
  2. Empty scratch space allocation is unguarded when using USM host memory. This leads to runtime issues or bad_alloc.
  3. The guards to support older compilers (Extend compiler support for the unified USM and buffer storage #1410) are missing.
  4. __get_usm_host_or_buffer_accessor_ptr is not needed anymore.

I have a WIP branch here dev/julianmi/fix_reduce_1354 that will eventually address all four issues. So I think we can close this one.

Copy link
Contributor

@SergeyKopienko SergeyKopienko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@julianmi
Copy link
Contributor

I believe #1503 supersedes this PR by including this macro fix and several other fixes.

@mmichel11 mmichel11 closed this Apr 16, 2024
@mmichel11 mmichel11 deleted the dev/mmichel11/usm_reduce_fix branch August 20, 2024 21:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants